﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SPMS.Utility.Storage
{
    /// <summary>
    /// 命名数据存储器
    /// </summary>
    /// <remarks>定义了命名数据存储器</remarks>
    /// <history>
    /// [ZaneZeng]               2009-5-20 14:31    创建
    /// </history>
    public interface INamedStorage
    {
        /// <summary>
        /// 从当前线程本地存储器中获得与给定名称关联的数据
        /// </summary>
        /// <param name="name">线程本地存储器中数据项的名称</param>
        /// <returns>线程本地存储器中存储的与给定名称关联的数据项</returns>
        /// <remarks></remarks>
        /// <history>
        /// [ZaneZeng]               2009-5-20 12:25    创建
        /// </history>
        object GetData( string name );

        /// <summary>
        /// 以给定的名称项当前线程本地存储中添加给定数据项
        /// </summary>
        /// <param name="name">数据项关联的名称</param>
        /// <param name="data">要添加的数据项</param>
        /// <remarks></remarks>
        /// <exception cref="ArgumentNullException"><paramref name="name"/>为Null或者为空字符串</exception>
        /// <history>
        /// [ZaneZeng]               2009-5-20 12:26    创建
        /// </history>
        void SetData( string name, object data );
    }
}
